package com.ray.pojo;

public class SSEObject {

	private Object data;
	private String retry="";
	private String event="";
	private String id="";
	public SSEObject() {
	}
	public SSEObject(Object data) {
		super();
		setData(data);
	}
	
	public SSEObject setData(Object data) {
		this.data = "data:"+data+"\n";
		return this;
	}
	public SSEObject setRetry(String retry) {
		this.retry = "retry:"+retry+"\n";
		return this;
	}
	public SSEObject setEvent(String event) {
		this.event = "event:"+event+"\n";
		return this;
	}
	public SSEObject setId(String id) {
		this.id = "id:"+id+"\n";
		return this;
	}
	public String endMessage(){
		return this.id+this.retry+this.event+this.data+"\n";
	}
	
}
